#ifndef _KLAS_PARTICLE_HPP_
#define _KLAS_PARTICLE_HPP_

#include "../include/Vector2.hpp"
#include "../include/Texture.hpp"
#include "../include/ParticleEmitter.hpp"

namespace klas
{
  class ParticleEmitter;

  //! The particle is used by the ParticleEmitter.
  /*! I can't think of any reason why this class would need to
      be used externally. */
  class Particle
  {
    public:

      //! Ctor.
      Particle();

      //! Dtor.
      ~Particle();

      //! Recreates the particle, effectively making it a completely new object.
      /*! \param lifespan The life of the particle, in seconds.
          \param initialScale The initial scale of the particle.
          \param finalScale The final scale of the particle.
          \param velocity The velocity of the particle.
          \param pos The position of the particle.
          \param intialCol The initial color of the partical.
          \param finalCol The final color of the partical. */
      void recreate(Real lifespan, Real initialScale, Real finalScale,
                        const Vector2<Real>& velocity, const Vector2<Real>& pos, 
                        const Color& initialCol, const Color& finalCol, 
                        Texture* tex);

      //! Updates the particles position and velocity, amoung other things.
      /*! \param dt The time since the particle was last updated.
          \param dampening The value to multiply the velocity of the particle by. */
      void update(Real dt, Real dampening);

      //! Renders the particle.
      /*! \param camPos The position of the camera.  Passed as a Vector2 for speed. */
      void render(const Vector2<Real>& camPos);

      //! Gets if the particle is dead.
      /*! \return True if the particle is no longer visible, otherwise false. */
      bool isDead() const;


    private:

      //! The amount of time the particle has left to live, in MS.
      Real m_life,

      //! The current size of the particle.
           m_currentScale,
           
      //! The target size of the particle.
           m_targetScale;

      //! The current color of the particle.
      Color m_currentCol,

      //! The color the particle is trying to become.
            m_targetCol;

      //! The current velocity of the particle.
      Vector2<Real> m_velocity,

      //! The current position of the particle.
            m_pos;

      //! The texture of the particle.
      Texture* m_tex;

  };
}

#endif
